Package pl. wendigo. chrome
Contains library main entrypoint class (Browser) responsible for connecting to remote headless Chrome instance, creating and managing targets (web pages).
Browser object can be obtained using Browser.Builder. Then Targets can be created using Browser.target method.
Samples
import pl.wendigo.chrome.Browser
import pl.wendigo.chrome.sync
fun main() {
//sampleStart
val browser = Browser.builder()
.withAddress("127.0.0.1:9222")
.withBlankPage("about:blank")
.withViewportWidth(1280)
.withViewportHeight(1024)
.withEventsBufferSize(128)
.multiplexConnections(true)
.incognito(true)
.build()
// create new Target that will start loading google.com
val target = browser.target(url = "https://google.com")
// enable Page domain events
sync(target.Page.enable())
// wait for the page to load
sync(target.Page.loadEventFired().firstOrError())
//sampleEnd
}
import pl.wendigo.chrome.Browser
fun main() {
//sampleStart
val browser = Browser.builder()
.withAddress("127.0.0.1:9222")
.withBlankPage("about:blank")
.withViewportWidth(1280)
.withViewportHeight(1024)
.withEventsBufferSize(128)
.multiplexConnections(true)
.incognito(true)
.build()
println(browser.browserInfo())
//sampleEnd
}
Types
Browser
Link copied to clipboard
BrowserInfoDiscoveryFailedException
Link copied to clipboard
class BrowserInfoDiscoveryFailedException(reason: String) : RuntimeException
Content copied to clipboard
FlowableBlock
Link copied to clipboard
SingleBlock
Link copied to clipboard